Skip to content

Pfp frontend#114

Closed
spokonya wants to merge 29 commits intomainfrom
pfp-frontend
Closed

Pfp frontend#114
spokonya wants to merge 29 commits intomainfrom
pfp-frontend

Conversation

@spokonya
Copy link
Copy Markdown
Contributor

@spokonya spokonya commented Feb 7, 2026

Description

TODO:

  • 1 PR for backend changes
  • 1 PR for shared changes
  • New branch for web changes:
    • Copy how things were implemented in the demo flow but in the actual page that pfp's are

New profile pic page at /flows/pfp with the ability to delete and upload a photo using the functionality in the other S3 PR's

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactoring (code improvement without changing functionality)
  • Documentation update
  • Configuration/infrastructure change
  • Performance improvement
  • Test coverage improvement

Related Issue(s)

Closes #
Related to #51

What Changed?

-Frontend pfp page with hardcoded data
-Upload and delete buttons

Testing & Validation

How this was tested

Screenshots/Recordings

Screenshot 2026-02-06 at 12 52 19 PM Screenshot 2026-02-06 at 12 52 38 PM Screenshot 2026-02-06 at 12 51 06 PM

Unfinished Work & Known Issues

  • None, this PR is complete and production-ready
  • The following items are intentionally deferred:



Notes & Nuances



Pre-Merge Checklist

Code Quality

  • Code follows the project's style guidelines and conventions
  • Self-review completed (I've reviewed my own code for obvious issues)
  • No debugging code, console logs, or commented-out code left behind
  • No merge conflicts with the base branch
  • Meaningful commit messages that explain the "why"

Testing & CI

  • All CI checks are passing
  • All new and existing tests pass locally
  • Test coverage hasn't decreased (or decrease is justified)
  • Linting passes without errors

Documentation

  • Code is self-documenting or includes helpful comments for complex logic
  • API documentation updated (if backend endpoints changed)
  • Type definitions are accurate and up-to-date

Reviewer Notes

  • Areas needing extra attention: ...
  • Questions for reviewers: ...

@Dao-Ho Dao-Ho requested a review from danctila February 14, 2026 04:10
Copy link
Copy Markdown
Contributor

@danctila danctila left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

couple cmmts to look into and one other thing about code quality:

right now this file is currently doing:

  1. API calls for fetching, uploading, saving, deleting, getting presigned URLs
  2. Business logic for the 4-step upload and file extension parsing
  3. State management for the 4 pieces of state wired together manually
  4. UI rendering of the full page

^ this is pretty much the entire stack in one file so we want to pull out a lot of this to different places. The UI will mostly get scrapped later since this is just a test page but the API layer for example should be extracted to somewhere like shared in its own module with reusable functions

The upload logic should also be a custom hook. The 4-step upload, state management for the loading state and storing the URL as well as handleUpload / handleRemove / etc... handlers can all be used in a useProfilePicture hook. The component would be simple and it's only job would be to render instead of managing the async workflow. For example

const { profilePicUrl, status, isLoading, handleUpload, handleRemove } = useProfilePicture(userId)

Also getFileExtension should be moved to utilities since it doesn't have anything to do with this component specifically

After splitting the code up the route file itself would shrink to basically just rendering the UI and calling into the hook and later when we use this in the profile page it will be much easier to reuse

Base automatically changed from profile-picture-endpoints to main April 4, 2026 21:15
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 8, 2026

Codecov Report

❌ Patch coverage is 0% with 145 lines in your changes missing coverage. Please review.
✅ Project coverage is 9.35%. Comparing base (362353c) to head (17e9a4c).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
clients/web/src/hooks/use-profile-picture.ts 0.00% 92 Missing ⚠️
.../internal/service/storage/postgres/s3/s3storage.go 0.00% 43 Missing ⚠️
clients/web/src/routeTree.gen.ts 0.00% 7 Missing ⚠️
clients/web/src/routes/flows.pfp.tsx 0.00% 2 Missing ⚠️
backend/internal/service/server.go 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##            main    #114      +/-   ##
========================================
- Coverage   9.53%   9.35%   -0.19%     
========================================
  Files        142     145       +3     
  Lines       7266    7410     +144     
  Branches      22      22              
========================================
  Hits         693     693              
- Misses      6557    6701     +144     
  Partials      16      16              
Flag Coverage Δ
backend 15.68% <0.00%> (-0.25%) ⬇️
mobile 97.29% <ø> (ø)
web 4.68% <0.00%> (-0.11%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
backend/internal/handler/s3.go 0.00% <ø> (ø)
backend/internal/service/server.go 0.00% <0.00%> (ø)
clients/web/src/routes/flows.pfp.tsx 0.00% <0.00%> (ø)
clients/web/src/routeTree.gen.ts 0.00% <0.00%> (ø)
.../internal/service/storage/postgres/s3/s3storage.go 0.00% <0.00%> (ø)
clients/web/src/hooks/use-profile-picture.ts 0.00% <0.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@danctila danctila closed this Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants